<!DOCTYPE html>
<html lang="en" ng-app="mine">

	<head>
		<meta charset="UTF-8">
		<title>Title</title>
		<link rel="stylesheet" href="../css/reset.css" />
		<link rel="stylesheet" href="../css/nav.css" />
		<!--<link rel="stylesheet" type="text/css" href="../css/nava.css"/>-->
		<link rel="stylesheet" href="../css/personal.css" />
		<link rel="stylesheet" href="../css/foot.css" />
		<link rel="stylesheet" href="../css/oldphone.css" />
		<link rel="stylesheet" href="../css/set_success.css" />
		<link rel="stylesheet" href="../css/newphone.css" />
	</head>

	<body>
		<!--<div ng-include = "'nava.html'"></div>-->
		<div ng-include="'navcopy.html'"></div>
		<div class="per">
			<div class="clearfix">
				<div class="per_mid l">
					<div>
						<p>个人中心</p>
					</div>
					<ul>
						<li>
							<p>交易管理&nbsp;&nbsp;&nbsp;></p>
							<ul>
								<li>
									<a href="#/">我的账户</a>
								</li>
								<li>
									<a href="#/buy">我的订单</a>
								</li>
								<li>
									<a href="#/score">我的积分</a>
								</li>
								<li>
									<a href="#/scorebuy">积分订单</a>
								</li>
								<li>
									<a href="#/wallet">我的钱包</a>
								</li>
							</ul>
						</li>
						<li>
							<p>会员资料&nbsp;&nbsp;&nbsp;></p>
							<ul>
								<li>
									<a href="#/person">个人资料</a>
								</li>
								<li>
									<a href="#/address">地址管理</a>
								</li>
								<li>
									<a href="#/store">我的收藏</a>
								</li>
								<li>
									<a href="#/recentlook">最近浏览</a>
								</li>
								<li>
									<a href="#/modify">修改密码</a>
								</li>
							</ul>
						</li>
						<li>
							<p>站内信&nbsp;&nbsp;&nbsp;></p>
							<ul>
								<li>
									<a href="#/msg">我的消息</a>
								</li>
								<li>
									<a href="#/response">意见反馈</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>

				<div class="per_mid_right r">
					<ng-view></ng-view>
				</div>
			</div>
		</div>

		<div ng-include="'foot.html'"></div>
	</body>
	<script type="text/javascript" src="../js/adress.js"></script>
	<script type="text/javascript" src="../js/jquery-3.0.0.min.js"></script>
	<script type="text/javascript" src="../js/angular.min.js"></script>
	<script type="text/javascript" src="../js/angular-route.min.js"></script>
	<script type="text/javascript">
		var app = angular.module('mine', ['ngRoute']);
		app.config(function($routeProvider) {
			$routeProvider.when('/', {
				templateUrl: 'acount.html'
			});
			$routeProvider.when('/acountpay', {
				templateUrl: 'acountpay.html'
			});
			$routeProvider.when('/checkacount', {
				templateUrl: 'checkacount.html'
			});
			$routeProvider.when('/buy', {
				templateUrl: 'buy.html'
			});
			$routeProvider.when('/buycomment', {
				templateUrl: 'buycomment.html'
			});
			$routeProvider.when('/orderdetail', {
				templateUrl: 'orderdetail.html'
			});
			$routeProvider.when('/score', {
				templateUrl: 'score.html'
			});
			$routeProvider.when('/scorebuy', {
				templateUrl: 'scorebuy.html'
			});
			$routeProvider.when('/wallet', {
				templateUrl: 'wallet.html'
			});
			$routeProvider.when('/person', {
				templateUrl: 'person.html'
			});
			$routeProvider.when('/address', {
				templateUrl: 'address.html'
			});
			$routeProvider.when('/addarea', {
				templateUrl: 'addarea.html'
			});
			$routeProvider.when('/store', {
				templateUrl: 'store.html'
			});
			$routeProvider.when('/recentlook', {
				templateUrl: 'recentlook.html'
			});
			$routeProvider.when('/modify', {
				templateUrl: 'modify.html'
			});
			$routeProvider.when('/msg', {
				templateUrl: 'msg.html'
			});
			$routeProvider.when('/response', {
				templateUrl: 'response.html'
			});
			$routeProvider.when('/mess', {
				templateUrl: 'message.html'
			});
			$routeProvider.when('/oldphone', {
				templateUrl: 'oldphone.html'
			});
			$routeProvider.when('/newphone', {
				templateUrl: 'newphone.html'
			});
			$routeProvider.when('/set_success', {
				templateUrl: 'set_success.html'
			});
			$routeProvider.when('/t-shoping2', {
				templateUrl: 't-shoping2.html'
			});
			
		});
		
		
		var bubu = false;
		app.controller('perCtrl', function($scope) {
			$(function() {
				var D1 = new DateTime();
				D1.init('.form1', { //最外层div
					yearhead: '.yearhead', //选定的年
					monthhead: '.monthhead', //选定的月
					dayhead: '.dayhead', //选定的日
					year: '.years', //年容器
					month: '.months', //月容器
					day: '.days' //日容器
				});

				$('.yearout').each(function(index, element) { //点击显示
					$(element).click(function(e) {
						$(element).find('div:eq(' + 1 + ')').show();
						$(element).siblings('.yearout').find('div:eq(' + 1 + ')').hide();

					});
				});

			})

			function DateTime() {
				this.set = {
					yearhead: '.yearhead', //选定的年
					monthhead: '.monthhead', //选定的月
					dayhead: '.dayhead', //选定的日
					year: '.years', //年容器
					month: '.months', //月容器
					day: '.days' //日容器
				}
			}

			DateTime.prototype.init = function(obj1, obj2) {
				var This = this;
				this.obj = $(obj1);
				$.extend(This.set, obj2); //合并多个对象
				this.obj.each(function(index, element) {
					var myDate = new Date();
					var nowyear = myDate.getFullYear(); //当前年份
					var nowmonth = myDate.getMonth() + 1; //当前月份
					var nowday = myDate.getDate(); //当前几号
					var secyear = nowyear; //选择年份
					var secmonth = nowmonth; //选择月份
					var secday = nowday; //选择日
					var nums = [28, 29, 30, 31];

					years()
					months()
					days()
					setdatetime({
						nowyear: nowyear,
						nowmonth: nowmonth,
						nowday: nowday
					}); //设置最初始的时间

					function setdatetime(times) { //设置选中的当前时间
						$(element).find(This.set.yearhead).html(times.nowyear)
						$(element).find(This.set.monthhead).html(times.nowmonth)
						$(element).find(This.set.dayhead).html(times.nowday)
					}

					$(document).on('click', obj1 + ':eq(' + index + ') ' + This.set.year + ' div', function(e) {
						secyear = $(this).html()
						var re = /年|月|日/g
						secyear = secyear.replace(re, '');
						$(this).parent(This.set.year).hide()
						days();
						setdatetime({
							nowyear: secyear
						});
					});
					$(document).on('click', obj1 + ':eq(' + index + ') ' + This.set.month + ' div', function(e) {
						secmonth = $(this).html();
						var re = /年|月|日/g
						secmonth = secmonth.replace(re, '');
						$(this).parent(This.set.month).hide()
						days();
						setdatetime({
							nowmonth: secmonth
						});
					});
					$(document).on('click', obj1 + ':eq(' + index + ') ' + This.set.day + ' div', function(e) {
						secday = $(this).html();
						var re = /年|月|日/g
						secday = secday.replace(re, '');
						$(this).parent(This.set.day).hide()
						setdatetime({
							nowday: secday
						});
					});

					function years() {
						for(i = 2021; i >= 1980; i--) {
							if(i == nowyear) {
								$(element).find(This.set.year).append('<div >' + i + '</div>');
							} else {
								$(element).find(This.set.year).append('<div>' + i + '</div>');
							}
						}
					}

					function months() {
						for(i = 12; i >= 1; i--) {
							if(i == nowmonth) {
								$(element).find(This.set.month).append('<div>' + i + '</div>');
							} else {
								$(element).find(This.set.month).append('<div>' + i + '</div>');
							}
						}

					}

					function days() {

						$(element).find(This.set.day).html(''); //清空原有数据
						var day_num = nums[3]
							//This.runnian(secyear)&&secmonth==2?day_num=nums[1]:day_num=day_num
						if(This.runnian(secyear) && secmonth) {
							day_num = nums[1]
						}

						if((secmonth == 1 || secmonth == 3 || secmonth == 5 || secmonth == 7 || secmonth == 8 || secmonth == 10 || secmonth == 12)) {
							day_num = nums[3];
						}
						if((secmonth == 4 || secmonth == 6 || secmonth == 9 || secmonth == 11)) {
							day_num = nums[2];
						}

						if(!This.runnian(secyear) && secmonth == 2) {
							day_num = nums[0];
						}
						setdatetime({
							nowmonth: 12,
							nowday: day_num
						});
						for(i = day_num; i >= 1; i--) {
							if(i == nowday) {
								$(element).find(This.set.day).append('<div>' + i + '</div>');
							} else {
								$(element).find(This.set.day).append('<div>' + i + '</div>');
							}
						}
					}
				})

			}

			DateTime.prototype.runnian = function(secyear) { //判断是否闰年
				return((secyear % 4 == 0 && secyear % 100 != 0) || secyear % 400 == 0)
			}

			$('.handle').click(function() {
				$('.phote input').fadeIn('slow');
			})
			$('.phote input').each(function(a, b) {
				$(b).change(function() {
					var $file = $(this);
					var fileObj = $file[0];

					var windowURL = window.URL || window.webkitURL;
					var dataURL;
					//          $(this).parent().html("<img src='' />")
					var $img = $(this).parent().children('img');
					if(fileObj && fileObj.files && fileObj.files[0]) {
						dataURL = windowURL.createObjectURL(fileObj.files[0]);
						$img.attr('src', dataURL);
					} else {
						dataURL = $file.val();
						var imgObj = $(".baskfile img");
						// 两个坑:
						// 1、在设置filter属性时，元素必须已经存在在DOM树中，动态创建的Node，也需要在设置属性前加入到DOM中，先设置属性在加入，无效；
						// 2、src属性需要像下面的方式添加，上面的两种方式添加，无效；
						imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
						imgObj.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL;

					}
					$(this).css('display', 'none')
				})
			});
		});
		app.controller('navctrl', function($scope) {
			
			$('.pleaselogin').html(localStorage.getItem("name"));
			//我的订单
			$('.ding1').click(function(){
//				if (bubu) {
					window.location='personalcenter.html#/buy';
//				}else{
//					window.location='t-loadimg.html';
//				};
				
			});
			//我的消息
			$('.ding2').click(function(){
//				if (bubu) {
					window.location='personalcenter.html#/msg';
//				}else{
//					window.location='t-loadimg.html';
//				};
				
			});	
			//我的商家
			$('.ding3').click(function(){
//				if (bubu) {
					window.location='personalcenter.html#/store';
//				}else{
//					window.location='t-loadimg.html';
//				};
				
			});
						
			$('.t-tui').click(function(){
				if (bubu){
					$('.pleaselogin').html('');
					$(this).html('请登录');
					bubu = false;
					
				}else{
					$(this).html('退出');
					window.location='t-loadimg.html';
					localStorage.clear()
					bubu = true;
				}	
			})
			
			
			
			
			
			
			function getLocation() {
				if(navigator.geolocation) {
					navigator.geolocation.getCurrentPosition(showPosition, showError);
				} else {
					alert("浏览器不支持地理定位。");
				}
			}

			function showPosition(position) {
				var latlon = position.coords.latitude + ',' + position.coords.longitude;
				//baidu
				var url = "http://api.map.baidu.com/geocoder/v2/?ak=C93b5178d7a8ebdb830b9b557abce78b&callback=renderReverse&location=" + latlon + "&output=json&pois=0";
				$.ajax({
					type: "GET",
					dataType: "jsonp",
					url: url,
					beforeSend: function() {
						$("#baidu_geo").html('正在定位...');
					},
					success: function(json) {
						if(json.status == 0) {
							var add = json.result.formatted_address;
							var addre = add.substr(3, 3);
							$("#baidu_geo").html(addre);
						}
					},
					error: function(XMLHttpRequest, textStatus, errorThrown) {
						$("#baidu_geo").html(latlon + "地址位置获取失败");
					}
				});
				
			
			}

			function showError(error) {
				switch(error.code) {
					case error.PERMISSION_DENIED:
						alert("定位失败,用户拒绝请求地理定位");
						break;
					case error.POSITION_UNAVAILABLE:
						alert("定位失败,位置信息是不可用");
						break;
					case error.TIMEOUT:
						alert("定位失败,请求获取用户位置超时");
						break;
					case error.UNKNOWN_ERROR:
						alert("定位失败,定位系统失效");
						break;
				}
			}

			getLocation();
			
			
				//	下拉
			function move() {
				$('.a').mouseenter(function() {
					$('.one').fadeIn();
				});
				$('.one>li').hover(function() {
					$(this).children('.two').fadeIn();
				}, function() {
					$(this).children('.two').fadeOut();
				})

				$('.one').mouseleave(function() {
					$('.one').fadeOut()
				})
			};

			function moveout() {
				$('.a').mouseleave(function() {
					$('.one').fadeOut();
				});
			}
			move();
			moveout()
				//	下拉结束

			$('.nav_bottom>li').click(function() {
				$(this).css({
					backgroundColor: '#f08200',

				});
				$(this).children().css({
					color: 'white',
					borderRight: '1px solid #F08200'

				});
				$(this).siblings('li').children().css({
					color: 'black',
					borderRight: '1px solid #e9e9e9'

				});
				$(this).siblings('li').css({
					backgroundColor: 'white',

				})
			})
			$('.nav_bottom>li').eq(0).unbind("click");

			$('.btns1').click(function() {
				window.location.href = 'sousuokong.html'
			})
		});
		app.controller('addareactrl', function($scope) {
			var index;
			$('.privincehead').click(function() {
				//清空li
				$('.privince>li').remove();

				//循环添加
				for(var i = 0; i < provinceList.length; i++) {
					$('.privince').append('<li>' + provinceList[i].name + '</li>');
				};

				$('.privince>li').click(function() {
					index = $(this).index();
					$('.privince').toggle("slow");
					$('.city').text('');
					$('.country').text('');
					$('.privincehead').text($(this).text());
					$('.city>li').remove();
					for(var j = 0; j < provinceList[index].cityList.length; j++) {
						$('.city').append('<li>' + provinceList[index].cityList[j].name + '</li>');
					}

					$('.city>li').click(function() {
						$('.city').toggle("slow");
						$('.country').text('');
						$('.country>li').remove();
						$('.cityhead').text($(this).text());
						for(var k = 0; k < provinceList[index].cityList[$(this).index()].areaList.length; k++) {
							$('.country').append('<li>' + provinceList[index].cityList[$(this).index()].areaList[k] + '</li>')
						}
						$('.country>li').click(function() {

							$('.country').toggle("slow");
							$('.countryhead').text($(this).text());
						})
					})
				})
			})
			$('.privincehead').click(function() {
				$('.privince').toggle("slow");
			});
			$('.cityhead').click(function() {
				$('.city').toggle("slow");
			});
			$('.countryhead').click(function() {
				$('.country').toggle("slow");

			});
			$('.country>li').click(function() {
				$('.countryhead').text('');
				$('.countryhead').text($(this).text());
				$('.country').toggle("slow");
			})

		});
		app.controller('addressCtrl', function($scope, $http) {
			$http.get('../php/address.php').success(function(data) {
				$scope.a = data;
			});
			$scope.del = function(index) {
				$scope.a.splice(index, 1);
			}
			
			$scope.amend = function(){
				$('.address').fadeIn(1000);
				
				
				
				
				
				$('.save').click(function(){
					$('.address').fadeOut(2000);
				})
			}

		});
		app.controller('buyCtrl', function($scope) {
			//          $('.buytop li').click({
			//          	   $(this).parent().remomve();
			//          })
			//			
			$('.buytop').find('li:even').mouseenter(function() {

				$(this).css({
					backgroundColor: '#f08200'
				})
				$(this).siblings('li').css({
					backgroundColor: '#fff'
				})

			})
			$('.buytop li:nth-of-type(odd)').click(function() {

				var con = $.trim($(this).text());
				var cona = con.split('/');

				$('.buystate').each(function(i, e) {
					if($.trim($(e).text()) == con) {
						$(e).parents('.buyli').show();
					} else if($.trim($(e).text()).indexOf(cona[0]) >= 0 || $.trim($(e).text()).indexOf(cona[1]) >= 0) {
						console.log(1);
						$(e).parents('.buyli').show();
					} else {
						$(e).parents('.buyli').hide();
					}
					if(con == '全部') {
						$(e).parents('.buyli').show();
					}
				});

			});

			$('.cancel').click(function() {
				$(this).parent().parent().parent().parent().remove();
			})

			$('.buybottom li:nth-of-type(-n+7)').click(function() {
				$(this).css({
					backgroundColor: '#4b943d'
				})
				$(this).siblings().css({
					backgroundColor: '#fff'
				})

				$(this).siblings('li:nth-of-type(1)').css({
					backgroundColor: '#ddd'
				})
			})
			$('.buybottom li').eq(0).click(function() {

			})

		});
		app.controller('scorebuyctrl', function($scope) {
			$('.delscore').click(function() {
				$(this).parent().parent().parent().remove();
			})

		});
		app.controller('msgctrl', function($scope) {
			$('.delmsg').click(function() {
				$(this).parent().parent().parent().remove();
			})
		})
		app.controller('lookctrl', function($scope) {
			$('.dellook').click(function() {
				$(this).parent().remove();
			})
		});
		app.controller('walletctrl', function($scope) {
			$('.money').mouseenter(function() {
				$(this).css({
					backgroundColor: '#f4fff2'
				})
				$(this).siblings().css({
					backgroundColor: '#fff'
				})
			})
		});
				app.controller('changectrl', function($scope) {
					var yanimg = document.getElementsByClassName('imgs');
			var arr = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
				'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
			var arr1 = [];
			var donum;
			var deg;

			var arr2 = [];
			var a = '';
			var b = '';

//			var phone = document.getElementById('phonetext');

			for(var i = 0; i < 4; i++) {
				deg = Math.floor(Math.random() * 100 - 40);
				donum = Math.floor(Math.random() * 62);
				arr1.push(arr[donum])
				yanimg[0].innerHTML += "<span>" + arr1[i] + "</span>"
				$('.imgs span').eq(i).css({
					transform: 'rotateZ(' + deg + 'deg)'
				})
				a += arr1[i]

			}
			arr1 = [];
			$('.oneaga').click(function() {
				a = '';
				$('.imgs').children('span').remove()
				for(var i = 0; i < 4; i++) {
					deg = Math.floor(Math.random() * 100 - 40);
					donum = Math.floor(Math.random() * 62);
					arr1.push(arr[donum])
					yanimg[0].innerHTML += "<span>" + arr1[i] + "</span>";
					$('.yanimg span').eq(i).css({
						transform: 'rotateZ(' + deg + 'deg)'
					})
					a += arr1[i]
				}
				arr1 = [];
			})

			$('.registers').click(function() {
				for(var i = 0; i < 6; i++) {
					b += Math.floor(Math.random() * 9)
					if(/^1[34578]\d{9}$/.test($('#moname').val())) {
						$('#phoneco').val(b)
					}

				}
				b = ''
			})
					
					
					$('.sup').click(function() {
						if(!(/^1[34578]\d{9}$/.test($('#moname').val()))){
							alert('请输入正确手机号')
						}else if($('#mopas').val()==''){
							alert('请输入密码')
						}else if($('#mopas').val() != $('#mopasw').val()){
							alert('输入的密码不一致')
						}else if($('#phoneco').val()==''){
							alert('请输入手机验证码')
						}else if(a!=$('#safe').val()){
							alert('请输入正确验证码')
						}else{
							$('.succeed').fadeIn(1000);
							setTimeout(function(){
								$('.succeed').fadeOut(2000)
							},1000)
						}
					})
				});
		app.controller('commentctrl', function($scope) {

			$('.star').each(function(i, e) {
				$(e).find('img').on('click', function() {
					$(this).prevAll().attr('src', '../img/bigyellowstar.png');
					$(this).attr('src', '../img/bigyellowstar.png');
					$(this).nextAll().attr('src', '../img/graystar.png');
				})
			})

			$('.loadimg').each(function(i, e) {
				$(e).find('div').on('click', function() {
					$(this).children().css('display', 'block');
				})

			})
			$('.loadimg>div input').each(function(a, b) {
				$(b).change(function() {
					var $file = $(this);
					var fileObj = $file[0];

					var windowURL = window.URL || window.webkitURL;
					var dataURL;
					//          $(this).parent().html("<img src='' />")
					var $img = $(this).parent().children('img');
					if(fileObj && fileObj.files && fileObj.files[0]) {
						dataURL = windowURL.createObjectURL(fileObj.files[0]);
						$img.attr('src', dataURL);
					} else {
						dataURL = $file.val();
						var imgObj = $(".baskfile img");
						// 两个坑:
						// 1、在设置filter属性时，元素必须已经存在在DOM树中，动态创建的Node，也需要在设置属性前加入到DOM中，先设置属性在加入，无效；
						// 2、src属性需要像下面的方式添加，上面的两种方式添加，无效；
						imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
						imgObj.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL;

					}
					$(this).css('display', 'none')
				})
			});

			$('.comm').click(function() {
				$('.subsuccess').fadeIn('slow');
				setTimeout(function() {
					$('.subsuccess').fadeOut('slow')
				}, 2000)
			})

		})
		app.controller('oldCtrl', function($scope) {

			var yanimg = document.getElementsByClassName('yanimg')
			var arr = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
				'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
			var arr1 = []
			var donum;
			var deg;

			var arr2 = [];
			var a = '';
			var b = '';

			var phone = document.getElementById('phonetext');
			//手机验证码
			$('.getNum').click(function() {
				for(var i = 0; i < 6; i++) {
					b += Math.floor(Math.random() * 9)
					if(/^1[34578]\d{9}$/.test($('#phonetext').val())) {
						$('.get_num').val(b)
					} else(
						$('.t-wrong').css({
							display: 'block'
						})
					)

				}
				b = ''
			})
			for(var i = 0; i < 4; i++) {
				deg = Math.floor(Math.random() * 100 - 40);
				donum = Math.floor(Math.random() * 62);
				arr1.push(arr[donum])
				yanimg[0].innerHTML += "<span>" + arr1[i] + "</span>"
				$('.yanimg span').eq(i).css({
					transform: 'rotateZ(' + deg + 'deg)'
				})
				a += arr1[i]

			}
			arr1 = [];
			$('.spanbtn').click(function() {
				a = '';
				$('.yanimg').children('span').remove()
				for(var i = 0; i < 4; i++) {
					deg = Math.floor(Math.random() * 100 - 40);
					donum = Math.floor(Math.random() * 62);
					arr1.push(arr[donum])
					yanimg[0].innerHTML += "<span>" + arr1[i] + "</span>";
					$('.yanimg span').eq(i).css({
						transform: 'rotateZ(' + deg + 'deg)'
					})
					a += arr1[i]
				}
				arr1 = [];
			})

			$scope.sen = function() {
				if(!(/^1[34578]\d{9}$/.test($('.oldInput').val()))) {
					alert('请输入正确的手机号')
				} else if(a != $('.phonedl').val()) {
					alert('请输入正确的验证码')
				} else if($('.identify').val() == '') {
					alert('请输入正确的密码')
				} else {
					var href = window.location.href;
					var hrefs = href.split('#');
					window.location.href = hrefs[0] + '#/newphone';
				}

			}
		})
		app.controller('newctrl', function($scope) {
			var yanimg = document.getElementsByClassName('yanimg')
			var arr = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
				'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
			var arr1 = [];
			var donum;
			var deg;

			var arr2 = [];
			var a = '';
			var b = '';

			var phone = document.getElementById('phonetext');

			for(var i = 0; i < 4; i++) {
				deg = Math.floor(Math.random() * 100 - 40);
				donum = Math.floor(Math.random() * 62);
				arr1.push(arr[donum])
				yanimg[0].innerHTML += "<span>" + arr1[i] + "</span>"
				$('.yanimg span').eq(i).css({
					transform: 'rotateZ(' + deg + 'deg)'
				})
				a += arr1[i]

			}
			arr1 = [];
			$('.spanbtn').click(function() {
				a = '';
				$('.yanimg').children('span').remove()
				for(var i = 0; i < 4; i++) {
					deg = Math.floor(Math.random() * 100 - 40);
					donum = Math.floor(Math.random() * 62);
					arr1.push(arr[donum])
					yanimg[0].innerHTML += "<span>" + arr1[i] + "</span>";
					$('.yanimg span').eq(i).css({
						transform: 'rotateZ(' + deg + 'deg)'
					})
					a += arr1[i]
				}
				arr1 = [];
			})

			$('.resetgetnum').click(function() {
				for(var i = 0; i < 6; i++) {
					b += Math.floor(Math.random() * 9)
					if(/^1[34578]\d{9}$/.test($('.phonediv').val())) {
						$('.phonethr').val(b)
					}

				}
				b = ''
			})

			$scope.sens = function() {
				if(!(/^1[34578]\d{9}$/.test($('.phonediv').val()))) {
					alert('请输入正确的手机号')
				} else if(a != $('.phonecode').val()) {
					alert('请输入正确的验证码')
				} else if($('.phonethr').val() == '') {
					alert('请输入正确的手机验证码')
				} else {
					var href = window.location.href;
					var hrefs = href.split('#');
					window.location.href = hrefs[0] + '#/set_success';
				}

			}
		})
	</script>

</html>